<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.

Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap'); 
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'校友汇',
    
	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
                'application.extensions.phpexcel.*',
                'application.extensions.GsearchPager.*'
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'123',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
			'generatorPaths' => array(  
            'bootstrap.gii'  
        ) ,
		),
		'xyhadm',
            //'shops',
		
       // 'auth' => array(
	    	//'class' => 'application.modules.auth.AuthModule' // Path to module in backend.
		//),
		
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
                     'class'=>'WebUser',
		),
		// uncomment the following to enable URLs in path-format
		
		'urlManager'=>array(
			'urlFormat'=>'path',
                        'showScriptName' => false,  
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),

		   'authManager' => array(
			'class'	=> 'CDbAuthManager',
                        'defaultRoles'=>array('guest'),
			'connectionID' => 'db'
		),
		
		//'db'=>array(
			//'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
		//),
		// uncomment the following to use a MySQL database
		
		'db'=>array(

			//'connectionString' => 'mysql:host=localhost;dbname=xiaoyou',
                  
                     'connectionString' => 'mysql:host=192.168.199.240;dbname=xiaoyou',

			'emulatePrepare' => true,
			'username' => 'root',
			'password' => 'root',
			'charset' => 'utf8',
                        'tablePrefix' => 'xyh_',
                        'enableParamLogging' => true,
                      //  'enableProfiling' => YII_DEBUG,
                       // 'enableParamLogging' => YII_DEBUG,
        ),
		/*
            'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=happy_shake',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
                ),
                 * */
//		'errorHandler'=>array(
//			// use 'site/error' action to display errors
//			'errorAction'=>'site/error',
//		),
		'bootstrap' => array(
    				'class' => 'bootstrap.components.Bootstrap',
    				'responsiveCss' => true,
    				'fontAwesomeCss' => true,
    				//'enableCdn' => true,
                                ),
            'jump'=>array(
            'class'=>'ext.jumpage.jumpage',
		    'successWait'=>2,//成功提示等待跳转时间，可以不指定，默认是2秒
		    'errorWait'=>3 //错误信息等待跳转时间，同上，默认3秒
                ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
						 'class'    => 'CFileLogRoute',
	                    'levels'   => 'info, trace',
	                	'logFile' => 'console.log',
	                 	'categories'=>'system.db.*', 
				),
				// uncomment the following to show log messages on web pages
//				 array(  
//                    'class'=>'CWebLogRoute',  
//                                        'levels'=>'trace, info, error, warning, xdebug',  
//                                        'categories' =>'system.db.*'  
//                ),  
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
                'adminUrl'=>'xyhadm',
				 'HTTP_HOST'=>$_SERVER['HTTP_HOST'],
				 //'HTTP_HOST'=>'ti.211xyh.com',
            
	),
    
);